package com.solcoo.service;

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.solcoo.dao.RecommendDao;
import com.solcoo.util.SendMsgUtil;

@Service
public class RecommendService {

	public static final String MENU_PATH = "static/pic/menu/";
	
	@Resource
	private RecommendDao recommendDao;

	public Map<String, Object> addRecommend(String telephone, String recommended, String rdtype, String apptype) throws Exception {
		if(apptype==null || "".equals(apptype)) {
			apptype = "2";
		}
		recommendDao.addRecommend(telephone, recommended, rdtype, apptype);
		String content = "搜卡，为您省钱的手机APP软件。下载地址：http://42.120.7.37/Solcoo/app/ @";
		new SendMsgUtil(telephone, content, "2").SendMsg();
		Map<String, Object> result = new HashMap<String, Object>();
		result.put("result", true);
		result.put("msg", "推荐成功！");
		return result;
	}
}